import { DrawerManager } from "./manager";
import { CommonDrawerType } from "./constant";

export function drawerFactory<T>(
  drawerType: CommonDrawerType,
  drawerManager: DrawerManager
) {
  const create = (options: T) => {
    drawerManager.pushStack(drawerType, options);
  };
  const destroy = () => {
    drawerManager.popStack();
  };

  return {
    create,
    destroy,
  };
}
